<style>
	.feed_red{
		background-color:rgb(255, 0, 0);
		width: 2px;
		height: 20px;
	}
	.feed_green{
		background-color:rgb(0, 204, 102);
		width: 2px;
		height: 20px;
	}
	.feed_yellow{
		background-color:rgb(255, 255, 0);
		width: 2px;
		height: 20px;
	}
</style>

<?php $filter = array('founder','client');

$dateid	 	= isset($date_id) ? $date_id : date('d');
$monthid 	= isset($month_id) ? $month_id : date('m');
$yearid 	= isset($year_id) ? $year_id : date('y');

$ndateid = ltrim($dateid,'0');


$monthid = ltrim($monthid,'0');

if(isset($date_id)){
				
				if($dateid < 10)
				{
					$dateID = '0'.$dateid;
				}else{
					$dateID = $dateid;
				}
			}
			else{
				
				$dateID = $dateid;
			}

		if($monthid < 10)
				{
					$monthID = '0'.$monthid;
				}else{
					$monthID = $monthid;
				}
			

$previous_month 	= ($monthID - 1);
$next_month		 = ($monthID + 1);

$d = '20'.$yearid;

$num = cal_days_in_month(CAL_GREGORIAN, $monthid , $d );

?>

<ul class="pager">
<?php if($previous_month > 0) {?>
  <li class="previous">
    <a href="<?php echo site_url('founder/worksheet/all_worksheet/'.$yearid.'/'.$previous_month.'/'.$dateid)?>">&larr; Previous Month</a>
  </li>
  <?php } if($next_month <= 12) {?>
  <li class="next">
    <a href="<?php echo site_url('founder/worksheet/all_worksheet/'.$yearid.'/'.$next_month.'/'.$dateid)?>">Next Month &rarr;</a>
  </li>
  <?php }?>
</ul>

<h3>Worsheet For 
<?php 
$monthName = date("F", mktime(0, 0, 0, $monthid, 10));

echo '20'.$yearid.'/'.$monthName.'/'.$dateid;?></h3>

<div class="pagination" style="font-size: 9px;">
  <ul>
    <?php 	
	for($i=1;$i<=$num;$i++) {?>    
	<li
	<?php if($dateID == $i){?>
	class="active"
	<?php }?>
	>
	<?php if($dateID == $i){?>
	<a href="#"><?php echo $i?></a>
	<?php } else {?>
	<a href="<?php echo site_url('founder/worksheet/all_worksheet/'.$yearid.'/'.$monthid.'/'.$i)?>"><?php echo $i?></a>
	<?php }?>
	
	
	</li>
	<?php }?>
  </ul>
</div>

<div class="row-fluid">
	<div class="span12">
		<table class="table  table-condensed" width="100%">
	<tr>
	<?php if($this->ion_auth->is_admin()){?>	
		<th width="20%">Select User <span class="red">*</span></th>
		<?php }?>
		<th width="70%">Remark <span class="red">*</span></th>
		<td></td>
	</tr>
	<tr>
	<?php if($this->ion_auth->is_admin()){?>	
	<td>
	<input type="hidden" name="date" id="date" value="<?= $dateid; ?>"/>
	<input type="hidden" name="year" id="year" value="<?= $yearid; ?>"/>
	<input type="hidden" name="month" id="month" value="<?= $monthid; ?>"/>
	
	
	<select class="chzn-select" name="user" id="user">
		<option value="0">
			All Users
		</option>
		<?php
		foreach($users as $user)
		{
			if(!($this->ion_auth->is_client($user->id)) && ($this->ion_auth->is_active($user->id)) )
			{	
			?>
			<option value="<?= $user->id?>">
				<?= $user->username?>
			</option>
			<?php
		}}?>
	</select>
	<?php } else {?>
	<input type="hidden" name="user" id="user" value="<?= $this->session->userdata('user_id');?>"/>
	<?php }?>
	</td>
		<td>
			<input type="text" class="span12" name="remark" id="remark" style="margin-top: 2px"/>
		</td>
		<td><input type="submit" value="Post" class="btn btn-success" id="remarks"/>
	</td></tr>
</table>
	</div>
</div>

<input type="submit" value="Verify" class="btn btn-info" id="verify" style="float: left; margin-bottom: 10px"/>

<div class="row-fluid">
<div class="span12">
<form action="<?php echo site_url('founder/worksheet/verify_worksheet');?>" id="multiple_submit" method="POST">	
<table class="table table-bordered table-striped table-condensed" width="100%">	
	<tr>
		<th width="18%">Name <input type="checkbox" name="all" id="all" onchange="select_all();" value="all" style="float: right;"></th>
		<th width="68%">Work Details</th>
		<th width="14%">Time Spent</th>
	</tr>
	<?php foreach($users as $user){
	if($this->ion_auth->is_active($user->id) AND  !$this->ion_auth->is_client($user->id)){	
	?>
	<tr>
		<td>
		<a style="float: left" href="<?php echo site_url('user/worksheet/index/'.$user->id.'/'.	$yearid.'/'.$monthid);?>" target="_blank">
	<?php echo $user->username?></a>
	
	<input type="hidden" name="date[]" value="<?= $dateid; ?>"/>
	<input type="hidden" name="year[]" value="<?= $yearid; ?>"/>
	<input type="hidden" name="month[]" value="<?= $monthid; ?>"/>	
	<?php
	$where = array(
				'year_id' 	=> 	$yearid,
				'month_id' 	=>	$monthID,				
				'user_id'	=>	$user->id,	
				'date_id'	=> 	$dateID,
				);	
		$get_work_verify = $this->worksheet_model->get_worksheet_verify($where);
		foreach($get_work_verify as $vid)
		{
		if(!empty($get_work_verify))
		{
		if($user->id == $vid->user_id){?>
			&nbsp; <img src="<?= $this->config->base_url(); ?>assets/img/tick.png" >
			<?php }}}?>
	<a style="float: right"><input type="checkbox" name="user_id[]" class="alls" value="<?= $user->id; ?>"/></a>
	

		<br><br>
		<?php 	
		$where = array(
				'year_id' 	=> 	$yearid,
				'month_id' 	=>	$monthID,				
				'user_id'	=>	$user->id,	
				'date_id'	=> 	$dateID,
				);	
						
		$alltime = $this->worksheet_model->get_all_time($where);
			if($alltime){
				echo '<table class="table table-striped table-condensed">';
				echo "<tr><td><b class='text-success'>Entry:</b></td> "."<td>";
				if(!empty($alltime['entry_time']))
				{
					if($alltime['entry_flag']==0)
					{
				echo date("g:i a", strtotime($alltime['entry_time']))."</td></tr>";
					}else{
				echo '<span class="text-success">'.date("g:i a", strtotime($alltime['entry_time'])).'</span>'."</td></tr>";		
					}
				}
				echo "<tr><td><b class='text-warning'>Lunch In:</b></td>"."<td>";
				if(!empty($alltime['lunch_in_time']))
				{
					if($alltime['lunch_in_flag']==0)
					{
				echo date("g:i a", strtotime($alltime['lunch_in_time']))."</td></tr>";
					}else{
				echo '<span class="text-success">'.date("g:i a", strtotime($alltime['lunch_in_time'])).'</span>'."</td></tr>";		
					}
				}
				echo "<tr><td><b class='text-info'>Lunch Out:</b></td>"."<td>";
				if(!empty($alltime['lunch_out_time']))
				{
					if($alltime['lunch_out_flag']==0)
					{
				echo date("g:i a", strtotime($alltime['lunch_out_time']))."</td></tr>";
					}else{
				echo '<span class="text-success">'.date("g:i a", strtotime($alltime['lunch_out_time'])).'</span>'."</td></tr>";		
					}
				}
				echo "<tr><td><b class='text-error'>Exit:</b></td>"."<td>";
				if(!empty($alltime['exit_time']))
				{
					if($alltime['exit_flag']==0)
					{
				echo date("g:i a", strtotime($alltime['exit_time']))."</td></tr>";
					}else{
				echo '<span class="text-success">'.date("g:i a", strtotime($alltime['exit_time'])).'</span>'."</td></tr>";				
					}
				}
				echo '</table>';
						}
		?>
		
		</td>
		<td>
		<table class="table table-bordered table-striped table-condensed" width="100%">
		<tr>
		<td width="10%" style="font-weight: bold;">Remark:</td>
			<td width="84%" class="text-info">
			<ul style="list-style-type: square"><?php 
			$search = array(
				'year_id' 	=> 	$yearid,
				'month_id' 	=>	$monthID,				
				'user_id'	=>	0,	
				'date_id'	=> 	$dateID,
				);		
			$remark = $this->worksheet_model->get_remarks($where);	
			$remarks_all = $this->worksheet_model->get_all_remarks($search);	
			if(!empty($remark) && $this->ion_auth->is_admin())
			{
			foreach($remark as $rm)
				{
			echo '<li>';
			echo $rm->remark;
			echo '<br></li>';
				}
			}
			
			if(!empty($remarks_all) && $this->ion_auth->is_admin())
			{
			foreach($remarks_all as $rma)
				{
			echo '<li>';
			echo $rma->remark;
			echo '<br></li>';
				}
			}
			?></ul>
		</td>
		<td width="6%"><?php
			if(!empty($remark) && $this->ion_auth->is_admin())
			{
			foreach($remark as $rm)
			{?>
			<a href="<?php echo site_url('founder/worksheet/delete_remark').'/'.$rm->id;?>"><i class="icon-trash"></i></a><br>
			<?php }}
			if(!empty($remarks_all) && $this->ion_auth->is_admin())
			{
			foreach($remarks_all as $rma)
			{?>
			<a href="<?php echo site_url('founder/worksheet/delete_remark').'/'.$rma->id;?>"><i class="icon-trash"></i></a><br>
			<?php }}?>
		</td>
		
		</tr>
		</table>
		
			<table class="table table-bordered table-striped table-condensed">
			<?php
			$dbtime_tot = 0;
			$bsumtime = 0;
			$bhours = 0;
			$bminutes=0;
			$tot_working_hr = null;
			
				$where = array(
				'year_id' 	=> 	$yearid,
				'month_id' 	=>	$monthID,				
				'user_id'	=>	$user->id,	
				'date_id'	=> 	$dateID,
				);		
			
			$works = $this->worksheet_model->get_all_worksheet_by_date($where);
			
			foreach($works as $work):			
			$dbtime_explode = explode(':',$work->time_spent);
		 			$dbtot_hr 		= $dbtime_explode[0]*60*60;
					$dbtot_min		= $dbtime_explode[1]*60;				
					$dbtime_tot 	+= $dbtot_hr + $dbtot_min;
			?>
			<tr>
			<td width="1%">
				<?php $feed=$work->feed; 
				if($feed=="1"){
					echo '<div class="feed_red"></div>';
				}elseif($feed=="2"){
					echo '<div class="feed_green"></div>';
				}elseif($feed=="3"){
					echo '<div class="feed_yellow"></div>';
				}else{
					echo '<div class="feed_green"></div>';
				}
				?>
			</td>
			<td width="83%"><?php echo $work->desc; ?> </td>		
			<td width="10%"> <?php echo $work->time_spent; ?> </td>		
			
				<td width="6%">
				<div class="dropdown">
					<a class="dropdown-toggle" data-toggle="dropdown" href="#"><i class="icon-cogs"></i>
  				<b class="caret"></b>
 					</a>
  				<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
					
  					<li><a class="red" style="cursor:pointer;" data-id="<?php echo $work->id ?>" data-color="1" ><i class="icon-ok-sign"></i> <span class="text-error">Red</span></a></li>
  					<li><a class="green" style="cursor:pointer;" data-id="<?php echo $work->id ?>" data-color="2" ><i class="icon-ok-sign"></i> <span class="text-error">Green</span></a></li>
					<li><a class="yellow" style="cursor:pointer" data-id="<?php echo $work->id ?>" data-color="3" ><i class="icon-ok-sign"></i> <span class="text-error">Yellow</span></a></li>
					<li><a href="<?php echo site_url('founder/worksheet/get_worksheet/'.$work->id);?>" class="get_worksheet"><i class="icon-wrench"></i> <span class="text-error">Edit</span></a>
					</li>
					<li><a href="<?php echo site_url('founder/worksheet/delete_worksheet').'/'.$work->id.'/'.$work->year_id.'/'.$work->month_id?>"><i class="icon-trash"></i> <span class="text-error">Delete</span></a></li>
  				</ul>
				</div>
				</td>
			
			</tr>
			<?php  endforeach; ?>
			</table>
				
			
		</td>
		<td>		
		<?php 
			if(!empty($dbtime_tot))
			{			
			$hours 			= floor($dbtime_tot/ 3600);
			$minutes 		= floor(($dbtime_tot / 60) % 60);
			$sumtime 		= $hours .' hr : '.$minutes.' min';	
			
			if($dateID	< 10):
					$dID = 'day_'.$dateID;
					//echo $ws->date_id;
					else:
					$dID = 'day_'.$dateID;
					endif;
			//
			//$monthID = str_replace();
					
			$bwhere = array(
					'year_id' 	=> 	$yearid,
					'month_id' 	=>	$monthID,				
					'user_id'	=>	$user->id,								
					);	
			
			/*$tt = $this->worksheet_model->get_total_working_hr($bwhere,$dID);
			$at = $this->worksheet_model->get_all_time($bwhere);
			
				if(!empty($tt)):
				$bt = explode(':',$tt);
				$bt_hr 		= $bt[0]*60*60;
				$bt_min		= $bt[1]*60;
				$tot_working_hr = $bt_hr + $bt_min;
				endif;	*/
				
				//if(!($tot_working_hr)):				
				
			$break_time = $tot_working_hr - $dbtime_tot;
			
			
				$bhours 		= floor(abs($break_time)/ 3600);
				$bminutes 		= floor((abs($break_time) / 60) % 60);
			 	$bsumtime 		= $bhours .' hr : '.$bminutes.' min';
			}		
					
		?>
		<table class="table table-striped table-condensed">
			<tr>
				<td><b class="text-error">Total</b></td>
				<td>
				<?php
								
				$where = array(
					'year_id' 	=> 	$yearid,
					'month_id' 	=>	$monthID,				
					'user_id'	=>	$user->id,
					'date_id'	=>	$dateID							
					);	
				$at = $this->worksheet_model->get_all_time($where);
					
				if(!empty($at['exit_time'])){
				$dbtime_ent = explode(':',$at['entry_time']);
		 		$dbtot_hrt 		= $dbtime_ent[0]*60*60;
				$dbtot_mint		= $dbtime_ent[1]*60;				
				$dbtime_tot_entt = $dbtot_hrt + $dbtot_mint;
				
				$dbtime_ext = explode(':',$at['exit_time']);
		 		$dbtot_hrt 		= $dbtime_ext[0]*60*60;
				$dbtot_mint		= $dbtime_ext[1]*60;				
				$dbtime_tot_extt = $dbtot_hrt + $dbtot_mint;
				
				$tott=$dbtime_tot_extt-$dbtime_tot_entt;
					
				$bhourst 		= floor(abs($tott)/ 3600);
				$bminutest 		= floor((abs($tott) / 60) % 60);
				echo $total_tm = $bhourst .' hr : '.$bminutest.' min';
				}
					
				?>
				</td>				
			</tr>	
			
			<tr>
				<td width="10%"><b class="text-warning">Office</b></td>
				<td width="90%">
					<?php
						$where = array(
					'year_id' 	=> 	$yearid,
					'month_id' 	=>	$monthID,				
					'user_id'	=>	$user->id,
					'date_id'	=>	$dateID							
					);	
				$at = $this->worksheet_model->get_all_time($where);
					
				if(!empty($at['exit_time'])){
				$dbtime_ent = explode(':',$at['entry_time']);
		 		$dbtot_hrt 		= $dbtime_ent[0]*60*60;
				$dbtot_mint		= $dbtime_ent[1]*60;				
				$dbtime_tot_entt = $dbtot_hrt + $dbtot_mint;
				
				$dbtime_ext = explode(':',$at['exit_time']);
		 		$dbtot_hrt 		= $dbtime_ext[0]*60*60;
				$dbtot_mint		= $dbtime_ext[1]*60;				
				$dbtime_tot_extt = $dbtot_hrt + $dbtot_mint;
				
				$lit = explode(':',$at['lunch_in_time']);
		 		$dbtot_hr_lit 		= $lit[0]*60*60;
				$dbtot_min_lit		= $lit[1]*60;				
				$dbtime_tot_lit = $dbtot_hr_lit + $dbtot_min_lit;
					
				$lot = explode(':',$at['lunch_out_time']);
		 		$dbtot_hr_lot 		= $lot[0]*60*60;
				$dbtot_min_lot		= $lot[1]*60;				
				$dbtime_tot_lot = $dbtot_hr_lot + $dbtot_min_lot;
				
				$lunch=$dbtime_tot_lot-$dbtime_tot_lit;
				
				$off=($dbtime_tot_extt-$dbtime_tot_entt)-$lunch;
					
				$bhours 		= floor(abs($off)/ 3600);
				$bminutes 		= floor((abs($off) / 60) % 60);
				echo $off_tm = $bhours .' hr : '.$bminutes.' min';
				}
					?>
				</td>
			</tr>	
			
			<tr>
				<td width="10%"><b class="text-success">Work</b></td>
				<td width="90%"><?php 
					$hours 			= floor($dbtime_tot/ 3600);
					$minutes 		= floor(($dbtime_tot / 60) % 60);
					$sumtime 		= $hours .' hr : '.$minutes.' min';	
				if(!empty($sumtime)){echo $sumtime;}?></td>
			</tr>

		</table>
		
		<table class="table table-striped table-condensed">
			<tr>
				<td width="10%"><b class="text-info">Lunch</b></td>
				<td width="90%">
					<?php 
					
				$where = array(
					'year_id' 	=> 	$yearid,
					'month_id' 	=>	$monthID,				
					'user_id'	=>	$user->id,
					'date_id'	=>	$dateID							
					);						
					$at = $this->worksheet_model->get_all_time($where);
					if(!empty($at['lunch_in_time']) && !empty($at['lunch_out_time'])){ 	
					
					$lit = explode(':',$at['lunch_in_time']);
		 			$dbtot_hr_lit 		= $lit[0]*60*60;
					$dbtot_min_lit		= $lit[1]*60;				
					$dbtime_tot_lit = $dbtot_hr_lit + $dbtot_min_lit;
					
					$lot = explode(':',$at['lunch_out_time']);
		 			$dbtot_hr_lot 		= $lot[0]*60*60;
					$dbtot_min_lot		= $lot[1]*60;				
					$dbtime_tot_lot = $dbtot_hr_lot + $dbtot_min_lot;
				
					$lunch=$dbtime_tot_lot-$dbtime_tot_lit;
					
					$bhours 		= floor(abs($lunch)/ 3600);
					$bminutes 		= floor((abs($lunch) / 60) % 60);
					echo $total_lunch_time = $bhours .' hr : '.$bminutes.' min';	
					}
					?>
					
				</td>
			</tr>
			<tr>
				<td ><b class="text-warning">Break</b></td>
				<td>
					<?php 	
					
				$where = array(
					'year_id' 	=> 	$yearid,
					'month_id' 	=>	$monthID,				
					'user_id'	=>	$user->id,
					'date_id'	=>	$dateID							
					);	
								
					$at = $this->worksheet_model->get_all_time($where);
					if(!empty($at['lunch_in_time']) && !empty($at['lunch_out_time']) && !empty($at['exit_time']) && !empty($at['entry_time'])){ 	
					
					$hours 			= floor($dbtime_tot/ 3600);
					$minutes 		= floor(($dbtime_tot / 60) % 60);
					$sumtime 		= $hours .' hr : '.$minutes.' min';	
					$dbtime_sum = explode(':',$sumtime);
		 			$dbtot_hr_sum 		= $dbtime_sum[0]*60*60;
					$dbtot_min_sum		= $dbtime_sum[1]*60;				
					$dbtime_tot_sum = $dbtot_hr_sum + $dbtot_min_sum;

					
					$dbtime_ent = explode(':',$at['entry_time']);
		 			$dbtot_hrt 		= $dbtime_ent[0]*60*60;
					$dbtot_mint		= $dbtime_ent[1]*60;				
					$dbtime_tot_entt = $dbtot_hrt + $dbtot_mint;
				
					$dbtime_ext = explode(':',$at['exit_time']);
		 			$dbtot_hrt 		= $dbtime_ext[0]*60*60;
					$dbtot_mint		= $dbtime_ext[1]*60;				
					$dbtime_tot_extt = $dbtot_hrt + $dbtot_mint;
				
					$tott=$dbtime_tot_extt-$dbtime_tot_entt;
					
					$lit = explode(':',$at['lunch_in_time']);
		 			$dbtot_hr_lit 		= $lit[0]*60*60;
					$dbtot_min_lit		= $lit[1]*60;				
					$dbtime_tot_lit = $dbtot_hr_lit + $dbtot_min_lit;
					
					$lot = explode(':',$at['lunch_out_time']);
		 			$dbtot_hr_lot 		= $lot[0]*60*60;
					$dbtot_min_lot		= $lot[1]*60;				
					$dbtime_tot_lot = $dbtot_hr_lot + $dbtot_min_lot;
				
					$lunch=$dbtime_tot_lot-$dbtime_tot_lit;					
					
					$break=($tott-$dbtime_tot_sum)-$lunch;
					
					$bhours 		= floor(abs($break)/ 3600);
					$bminutes 		= floor((abs($break) / 60) % 60);
					if($dbtime_tot_sum<=$tott)
					{
					echo $total_break_time = $bhours .' hr : '.$bminutes.' min';	
					}else{
						echo "Haha!! Wrong Entry";
					}
					}
					?>
				</td>
			</tr>		
		</table>
		
		</td>
		
	</tr>
	<?php }}?>
</table>
</form>
</div>
<!--<div class="span1">
	<header>Links</header>
	<?php 
	foreach($months as $month){
		?>
<a href="<?php echo site_url('founder/worksheet/all_worksheet/'.$month->year_id.'/'.$month->month_id.'/1') ?>"><?php echo $monthName = date("F", mktime(0, 0, 0, $month->month_id, 10));?>  </a>
<br />
	<?php } ?>
</div>-->	
</div>

<script>
	$("#remarks").click(function()
		{
			//alert("hello");
			var user = $("#user").val();
			var date_id = $("#date").val();
			var month_id = $("#month").val();
			var year_id = $("#year").val();
			var remark = $("#remark").val();
			
			//alert(user);
			if($("#user").val()=='')
			{
				alert("Field Cannot be empty")
				return false;
			}
			$('#loading-overlay').show();
			$('#loading').show();
			$.post('<?= site_url('founder/worksheet/add_remarks');?>',
				{
					user_id : user,date_id:date_id,month_id:month_id,year_id:year_id,remark:remark
				}, function(data)
				{	
				$('#loading-overlay').hide();
				$('#loading').hide();
				$('#remark').val("");
				alert("Your Remark Has been posted");
				window.location.reload();
				})
				
		})
		
		$(".red").click(function()
		{
			//alert("hello");
			var id = $(this).attr('data-id');
			var color = $(this).attr('data-color');
			
			$('#loading-overlay').show();
			$('#loading').show();
			$.post('<?= site_url('founder/worksheet/add_colors');?>',
				{
					id:id,color:color
				}, function(data)
				{
				$('#loading-overlay').hide();
				$('#loading').hide();
				window.location.reload();
				})
				
		})
		
		$(".green").click(function()
		{
			//alert("hello");
			var id = $(this).attr('data-id');
			var color = $(this).attr('data-color');
		
			$('#loading-overlay').show();
			$('#loading').show();
			$.post('<?= site_url('founder/worksheet/add_colors');?>',
				{
					id:id,color:color
				}, function(data)
				{	
				$('#loading-overlay').hide();
				$('#loading').hide();
				window.location.reload();
				})
				
		})
		
		$(".yellow").click(function()
		{
			//alert("hello");
			var id = $(this).attr('data-id');
			var color = $(this).attr('data-color');
	
			$('#loading-overlay').show();
			$('#loading').show();
			$.post('<?= site_url('founder/worksheet/add_colors');?>',
				{
					id:id,color:color
				}, function(data)
				{	
				$('#loading-overlay').hide();
				$('#loading').hide();
				window.location.reload();
				})
				
		})
		
/*		$("#verify").click(function()
		{
			//alert("hello");
			var user = $(".userid").val();
			var date_id = $(".date").val();
			var month_id = $(".month").val();
			var year_id = $(".year").val();
			var verify = $(".verify").val();
	
			$('#loading-overlay').show();
			$('#loading').show();
			$.post('<?= site_url('founder/worksheet/verify_worksheet');?>',
				{
					user_id : user,date_id:date_id,month_id:month_id,year_id:year_id,verify:verify
				}, function(data)
				{
					alert(data)	;
				$('#loading-overlay').hide();
				$('#loading').hide();
				//window.location.reload();
				})
				
		})*/
		
		  $('#verify').click(function(){
 			$('#multiple_submit').submit();	
 			});
		
		 $('.get_worksheet').click(function(event) {	
  			event.preventDefault();
  			$.get(this.href, function(html) {
  			$(html).appendTo('body').modal(); 
  			});
	});	

function select_all(){
	if(document.getElementById('all').checked){
		$('.alls').attr('checked','checked');
	}else{
		$('.alls').prop('checked', false);
		}
	}
	
</script>
